package io.gitee.thghh.generate.core.service.impl;

import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import io.gitee.thghh.generate.core.entity.TypeConfig;
import io.gitee.thghh.generate.core.mapper.TypeConfigMapper;
import io.gitee.thghh.generate.core.mapstruct.TypeConfigVoEntityMapstruct;
import io.gitee.thghh.generate.core.service.TypeConfigService;
import io.gitee.thghh.generate.core.vo.TypeConfigVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 数据库与java类型配置 服务层实现。
 *
 * @author pengzhikang
 * @since 2025-03-27
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class TypeConfigServiceImpl extends ServiceImpl<TypeConfigMapper, TypeConfig>  implements TypeConfigService {

    @Autowired
    private TypeConfigVoEntityMapstruct mapstruct;

    @Override
    public List<TypeConfig> list(TypeConfigVo queryVo) {
        QueryWrapper query = QueryWrapper.create(mapstruct.mapstruct(queryVo));
        return list(query);
    }


}
